function SrvQuery(params){ 
	 
}

SrvQuery.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new SrvQuery.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new SrvQuery.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new SrvQuery.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	
	
	/** 编号 [非空]       **/
	this.sqId=function(sqId){if(this.proxy)return this.getProxy().sqId(sqId);  this.put("sqId", sqId);return this;};
	/** and sq_id is null */
	this.sqIdNull=function(){if(this.proxy)return this.getProxy().sqIdNull();if(this.get("sqIdNot")==null)this.put("sqIdNot", "");this.put("sqId", null);return this;};
	/** not .... */
	this.sqIdNot=function(){if(this.proxy)return this.getProxy().sqIdNot();this.put("sqIdNot", "not");return this;};
	this.sqIdNotNull=function(){if(this.proxy)return this.getProxy().sqIdNotNull();this.put("sqIdNot", "not");this.put("sqId", null);return this;};
	this.sqIdNot=function(sqId){if(this.proxy)return this.getProxy().sqIdNot(sqId);this.put("sqIdNot", "not");this.put("sqId", sqId);return this;};
		
	/** and sq_id <= ? */
	this.sqIdMin=function(min){if(this.proxy)return this.getProxy().sqIdMin(min);this.put("sqIdMin", min);return this;};
	/** and sq_id >= ? */
	this.sqIdMax=function(max){if(this.proxy)return this.getProxy().sqIdMax(max);this.put("sqIdMax", max);return this;};
		
		
	this.sqIdIn=function(ids){
		if(this.proxy)return this.getProxy().sqIdIn(ids);  this.put("sqIdIn", ids);return this;
	};	
		 
	
	
	/** 查询名称 [非空]       **/
	this.sqName=function(sqName){if(this.proxy)return this.getProxy().sqName(sqName);  this.put("sqName", sqName);return this;};
	/** and sq_name is null */
	this.sqNameNull=function(){if(this.proxy)return this.getProxy().sqNameNull();if(this.get("sqNameNot")==null)this.put("sqNameNot", "");this.put("sqName", null);return this;};
	/** not .... */
	this.sqNameNot=function(){if(this.proxy)return this.getProxy().sqNameNot();this.put("sqNameNot", "not");return this;};
	this.sqNameNotNull=function(){if(this.proxy)return this.getProxy().sqNameNotNull();this.put("sqNameNot", "not");this.put("sqName", null);return this;};
	this.sqNameNot=function(sqName){if(this.proxy)return this.getProxy().sqNameNot(sqName);this.put("sqNameNot", "not");this.put("sqName", sqName);return this;};
		
		 
	
	
	/** 图标 [非空]       **/
	this.sqIcon=function(sqIcon){if(this.proxy)return this.getProxy().sqIcon(sqIcon);  this.put("sqIcon", sqIcon);return this;};
	/** and sq_icon is null */
	this.sqIconNull=function(){if(this.proxy)return this.getProxy().sqIconNull();if(this.get("sqIconNot")==null)this.put("sqIconNot", "");this.put("sqIcon", null);return this;};
	/** not .... */
	this.sqIconNot=function(){if(this.proxy)return this.getProxy().sqIconNot();this.put("sqIconNot", "not");return this;};
	this.sqIconNotNull=function(){if(this.proxy)return this.getProxy().sqIconNotNull();this.put("sqIconNot", "not");this.put("sqIcon", null);return this;};
	this.sqIconNot=function(sqIcon){if(this.proxy)return this.getProxy().sqIconNot(sqIcon);this.put("sqIconNot", "not");this.put("sqIcon", sqIcon);return this;};
		
		 
	
	
	/** 项目路径 [非空]       **/
	this.sqPath=function(sqPath){if(this.proxy)return this.getProxy().sqPath(sqPath);  this.put("sqPath", sqPath);return this;};
	/** and sq_path is null */
	this.sqPathNull=function(){if(this.proxy)return this.getProxy().sqPathNull();if(this.get("sqPathNot")==null)this.put("sqPathNot", "");this.put("sqPath", null);return this;};
	/** not .... */
	this.sqPathNot=function(){if(this.proxy)return this.getProxy().sqPathNot();this.put("sqPathNot", "not");return this;};
	this.sqPathNotNull=function(){if(this.proxy)return this.getProxy().sqPathNotNull();this.put("sqPathNot", "not");this.put("sqPath", null);return this;};
	this.sqPathNot=function(sqPath){if(this.proxy)return this.getProxy().sqPathNot(sqPath);this.put("sqPathNot", "not");this.put("sqPath", sqPath);return this;};
		
		 
	
	
	/** 查询参数 [非空]       **/
	this.sqParams=function(sqParams){if(this.proxy)return this.getProxy().sqParams(sqParams);  this.put("sqParams", sqParams);return this;};
	/** and sq_params is null */
	this.sqParamsNull=function(){if(this.proxy)return this.getProxy().sqParamsNull();if(this.get("sqParamsNot")==null)this.put("sqParamsNot", "");this.put("sqParams", null);return this;};
	/** not .... */
	this.sqParamsNot=function(){if(this.proxy)return this.getProxy().sqParamsNot();this.put("sqParamsNot", "not");return this;};
	this.sqParamsNotNull=function(){if(this.proxy)return this.getProxy().sqParamsNotNull();this.put("sqParamsNot", "not");this.put("sqParams", null);return this;};
	this.sqParamsNot=function(sqParams){if(this.proxy)return this.getProxy().sqParamsNot(sqParams);this.put("sqParamsNot", "not");this.put("sqParams", sqParams);return this;};
		
		 
	
	
	/** 添加人 [非空] [SrvUser]      **/
	this.sqEditor=function(sqEditor){if(this.proxy)return this.getProxy().sqEditor(sqEditor);  this.put("sqEditor", sqEditor);return this;};
	/** and sq_editor is null */
	this.sqEditorNull=function(){if(this.proxy)return this.getProxy().sqEditorNull();if(this.get("sqEditorNot")==null)this.put("sqEditorNot", "");this.put("sqEditor", null);return this;};
	/** not .... */
	this.sqEditorNot=function(){if(this.proxy)return this.getProxy().sqEditorNot();this.put("sqEditorNot", "not");return this;};
	this.sqEditorNotNull=function(){if(this.proxy)return this.getProxy().sqEditorNotNull();this.put("sqEditorNot", "not");this.put("sqEditor", null);return this;};
	this.sqEditorNot=function(sqEditor){if(this.proxy)return this.getProxy().sqEditorNot(sqEditor);this.put("sqEditorNot", "not");this.put("sqEditor", sqEditor);return this;};
		
		
	this.sqEditorIn=function(ids){
		if(this.proxy)return this.getProxy().sqEditorIn(ids);  this.put("sqEditorIn", ids);return this;
	};	
		 
	
	
	/** 修改时间 [非空]       **/
	this.sqUpdateTime=function(sqUpdateTime){if(this.proxy)return this.getProxy().sqUpdateTime(sqUpdateTime);  this.put("sqUpdateTime", sqUpdateTime);return this;};
	/** and sq_update_time is null */
	this.sqUpdateTimeNull=function(){if(this.proxy)return this.getProxy().sqUpdateTimeNull();if(this.get("sqUpdateTimeNot")==null)this.put("sqUpdateTimeNot", "");this.put("sqUpdateTime", null);return this;};
	/** not .... */
	this.sqUpdateTimeNot=function(){if(this.proxy)return this.getProxy().sqUpdateTimeNot();this.put("sqUpdateTimeNot", "not");return this;};
	this.sqUpdateTimeNotNull=function(){if(this.proxy)return this.getProxy().sqUpdateTimeNotNull();this.put("sqUpdateTimeNot", "not");this.put("sqUpdateTime", null);return this;};
	this.sqUpdateTimeNot=function(sqUpdateTime){if(this.proxy)return this.getProxy().sqUpdateTimeNot(sqUpdateTime);this.put("sqUpdateTimeNot", "not");this.put("sqUpdateTime", sqUpdateTime);return this;};
		
	/** and sq_update_time >= ? */
	this.sqUpdateTimeStart=function(start){if(this.proxy)return this.getProxy().sqUpdateTimeStart(start);this.put("sqUpdateTimeStart", start);return this;};			
	/** and sq_update_time <= ? */
	this.sqUpdateTimeEnd=function(end){if(this.proxy)return this.getProxy().sqUpdateTimeEnd(end);this.put("sqUpdateTimeEnd", end);return this;};
		
		 
	
	
	/** 添加时间 [非空]       **/
	this.sqAddTime=function(sqAddTime){if(this.proxy)return this.getProxy().sqAddTime(sqAddTime);  this.put("sqAddTime", sqAddTime);return this;};
	/** and sq_add_time is null */
	this.sqAddTimeNull=function(){if(this.proxy)return this.getProxy().sqAddTimeNull();if(this.get("sqAddTimeNot")==null)this.put("sqAddTimeNot", "");this.put("sqAddTime", null);return this;};
	/** not .... */
	this.sqAddTimeNot=function(){if(this.proxy)return this.getProxy().sqAddTimeNot();this.put("sqAddTimeNot", "not");return this;};
	this.sqAddTimeNotNull=function(){if(this.proxy)return this.getProxy().sqAddTimeNotNull();this.put("sqAddTimeNot", "not");this.put("sqAddTime", null);return this;};
	this.sqAddTimeNot=function(sqAddTime){if(this.proxy)return this.getProxy().sqAddTimeNot(sqAddTime);this.put("sqAddTimeNot", "not");this.put("sqAddTime", sqAddTime);return this;};
		
	/** and sq_add_time >= ? */
	this.sqAddTimeStart=function(start){if(this.proxy)return this.getProxy().sqAddTimeStart(start);this.put("sqAddTimeStart", start);return this;};			
	/** and sq_add_time <= ? */
	this.sqAddTimeEnd=function(end){if(this.proxy)return this.getProxy().sqAddTimeEnd(end);this.put("sqAddTimeEnd", end);return this;};
		
		 
	
	
	/** 状态 [非空]   1:正常 0:无效     **/
	this.sqStatus=function(sqStatus){if(this.proxy)return this.getProxy().sqStatus(sqStatus);  this.put("sqStatus", sqStatus);return this;};
	/** and sq_status is null */
	this.sqStatusNull=function(){if(this.proxy)return this.getProxy().sqStatusNull();if(this.get("sqStatusNot")==null)this.put("sqStatusNot", "");this.put("sqStatus", null);return this;};
	/** not .... */
	this.sqStatusNot=function(){if(this.proxy)return this.getProxy().sqStatusNot();this.put("sqStatusNot", "not");return this;};
	this.sqStatusNotNull=function(){if(this.proxy)return this.getProxy().sqStatusNotNull();this.put("sqStatusNot", "not");this.put("sqStatus", null);return this;};
	this.sqStatusNot=function(sqStatus){if(this.proxy)return this.getProxy().sqStatusNot(sqStatus);this.put("sqStatusNot", "not");this.put("sqStatus", sqStatus);return this;};
		
		
	this.sqStatusIn=function(ids){
		if(this.proxy)return this.getProxy().sqStatusIn(ids);  this.put("sqStatusIn", ids);return this;
	};	
		 
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有表单查询 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/configurator/query.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取表单查询分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/configurator/query.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取表单查询 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/configurator/query.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

SrvQuery.get = function(id){
	var protocol = ux.ajax("/admin/configurator/query.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.srvQuery;
	return null;
}

SrvQuery.where = new SrvQuery.Where(0,true);